cmake_minimum_required(VERSION 3.0.2)
project(buaa)

 set(CMAKE_BUILD_TYPE "Release")
 set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g")
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -O3 -mtune=native ")
 set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 add_definitions(-std=c++14 -g -O3 -ftree-vectorize )

find_package(catkin REQUIRED COMPONENTS
  roscpp
  message_filters
  #mav_msgs
  geometry_msgs
  sensor_msgs
  tf
  nav_msgs
  image_transport
  cv_bridge
  message_generation
)

# add_message_files(
#   FILES
#   DistributedOptimize.msg
# ) 

generate_messages(
  DEPENDENCIES
  std_msgs
)

find_package(PCL  REQUIRED)
find_package(OpenCV REQUIRED)
add_definitions(${PCL_DEFINITIONS})
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIRS})


add_definitions(${PCL_DEFINITIONS})

catkin_package( CATKIN_DEPENDS message_runtime)

include_directories(${PCL_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR}/include)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_library(formation_library STATIC src/formation.cpp  src/utils.cpp)
target_include_directories(formation_library PUBLIC  ${PROJECT_SOURCE_DIR}/include )

add_executable(agent src/agent.cpp )
target_link_libraries(agent formation_library  ${OpenCV_LIBS} ${PCL_LIBRARIES} ${catkin_LIBRARIES} )

#add_executable(test_ src/test_.cpp )
#target_link_libraries(test_  ${catkin_LIBRARIES} )

add_executable(read_csv src/read_csv.cpp )
target_link_libraries(read_csv  ${catkin_LIBRARIES} )